<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use backend\controllers\CategoryController;
use common\models\category\Category;
use frontend\controllers\ListController;
use common\models\member\Member;
use common\models\setting\Setting;
?>
<?php 
    $data = Category::find()->where(['status' => 1,'parent_id'=>0])->asArray()->all();
    $login = Yii::$app->user->identity;
	
	//电话号码
	$phone = '';
	try { $phone = Setting::findOne(['code'=>'phone'])->value;}
	catch(ErrorException $e){ }
	//网站logo
	$imgLOGO = '';
	try { $imgLOGO = Setting::findOne(['code'=>'imgLOGO'])->value;}
	catch(ErrorException $e){ }

?>
			<header>
				<div class="tou_box">
               
		               <div class="logo"><a href="<?= yii\helpers\Url::to(['/']);?>"><img src="/img/logo.png" /></a></div>
		               <div class="tou_right">
		                    <button class="seo"><img src="/img/seo.png"></button>     
							<script type="text/javascript">
							$(document).ready(function(){
							  $(".seo").click(function(){
							  $(".seo_box").toggle(300);
							  });
							});
							</script>           
					   <div class="mebbtn"><a href="/auth/login"><img src="/img/perimg.png" /></a></div>
		                    <div class="drawer-toggle drawer-hamberger"><span><img src="/img/meu.png"></span></div>
							<div class="drawer-main drawer-default">
								  <nav class="drawer-nav" role="navigation">
								       <div class="souso">
								       		<form method="get" action="<?= yii\helpers\Url::to(['list/search']);?>">
									       	    <input name="keywords" type="text" placeholder="请输入关键字" />
									       	    <input class="abc" type="submit" value="" />
								       		</form>
								       	</div>
								       <div id="firstpane" class="menu_list">
								            <h3><a href="<?= yii\helpers\Url::to(['/']);?>">网站首页</a></h3>
											<?php foreach($data as $vo){ ?>
									            <h3 class="menu_head"><?= $vo['name']; ?></h3>
												<div class="menu_body">
													<?php $data2 = Category::find()->where(['parent_id' => $vo['id'], 'status' => Category::STATUS_ACTIVE])->asArray()->all();?>
													<?php foreach($data2 as $t) { ?>
														 <a href="<?= yii\helpers\Url::to([$t['type'], 'id' => $t['id']]);?>"><?= $t['name']; ?></a>
													<?php } ?>
										        </div>
									        <?php } ?>
									   </div>
								<script type="text/javascript">
								$(document).ready(function(){
					
									/*$("#firstpane .menu_body:eq(0)").show();*/
									$("#firstpane h3.menu_head").click(function(){
										$(this).addClass("current").next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
										$(this).siblings().removeClass("current");
									});
									
									$("#secondpane .menu_body:eq(0)").show();
									$("#secondpane h3.menu_head").mouseover(function(){
										$(this).addClass("current").next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
										$(this).siblings().removeClass("current");
									});
									
								});
								</script>       
								  </nav>
							</div>                    
								            
		                    
		                    
		                    
		
		<!-- /.drawer-overlay --> 
		
		<script>
			$(document).ready(function(){
			$('.drawer').drawer();
			$('.js-trigger').click(function(){
			  $('.drawer').drawer("open");
			});
			});
		</script> 
		<!-- 代码 结束 -->
		               </div>
		               <div class="seo_box">
   						<form method="get" action="<?= yii\helpers\Url::to(['list/search']);?>">
				       	    <input class="seo_t" name="keywords" type="text" placeholder="请输入关键字" />
				       	    <input class="sumt" type="submit" value="搜索" />
			       		</form>
		               </div>
		        </div>
				
			</header>
